package jmvm.schemes;


import java.awt.Point;
import java.util.ArrayList;

import jmvm.components.*;
import jmvm.gui.GuiLine;
import jmvm.gui.GuiScheme;

public class Exec3 {
	
	// Prva slika ( levo )
	//
		public static OR NOR1;
		public static AND NAND1;
		public static NOT ZNOT0;
		public static NOT ZNOT1;
		public static NOT ZNOT2;
		public static NOT ZNOT3;
		public static NOT ZNOT4;
		public static NOT ZNOT5;
		public static NOT ZNOT6;
		public static NOT ZNOT7; 
		public static AND ZAND1;
		public static AND ZAND2;

	// Druga slika ( sredina )
	//
		public static OR OR_ADD_INC; // dodato
		public static OR OR_SUB_DEC; // dodato
		public static AND CAND1;
		public static AND CAND2;
		public static NOT CNOT1;
		public static OR COR1;
		public static AND CAND3;
		public static OR COR2;
		public static AND CAND4;
		public static OR COR3;

	// Treca slika ( desno )
	//
		public static NOT VNOT1;
		public static NOT VNOT2;
		public static AND VAND1;
		public static NOT VNOT3;
		public static AND VAND2;
		public static OR VOR1;
		public static AND VAND3;
		//
		public static NOT VNOT4;
		public static AND VAND4;
		public static NOT VNOT5;
		public static NOT VNOT6;
		public static AND VAND5;
		public static OR VOR2;
		public static AND VAND6;
		// dodato:
		public static NOT NOT_AB7;
		public static AND VAND7;
		public static AND VAND8;
		// dodato:
		public static NOT NOT_ALU7;
		public static AND VAND9;
		public static AND VAND10;
		//
		public static OR VOR3;

		////////////
		//////////// Grafika
		////////////
		
		public static GuiScheme gui;

		public static GuiScheme getGui() {
			return gui;
		}
		
		public static void gui() {

			GuiLine line; // Pomocna promenljiva
			gui = new GuiScheme("jmvm/jmvm/images/exec3.png");
			
			ArrayList<ArrayList<Point>> sections;
			ArrayList<Point> points;
			
			// 
			// 
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,92));
			points.add(new Point(96,92));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.LDB());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,109));
			points.add(new Point(96,109));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.POPB());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,127));
			points.add(new Point(96,127));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ADD());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,145));
			points.add(new Point(96,145));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.SUB());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,162));
			points.add(new Point(96,162));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.INC());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,180));
			points.add(new Point(96,180));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.DEC());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(96,197));
			points.add(new Point(80,197));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.AND());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,215));
			points.add(new Point(96,215));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.OR());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,233));
			points.add(new Point(97,233));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.XOR());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,250));
			points.add(new Point(98,250));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.NOT());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,268));
			points.add(new Point(96,268));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ASR());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,285));
			points.add(new Point(96,285));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.LSR());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,303));
			points.add(new Point(96,303));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ROR());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,321));
			points.add(new Point(96,321));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.RORC());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(81,338));
			points.add(new Point(96,338));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ASL());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,356));
			points.add(new Point(96,356));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.LSL());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,373));
			points.add(new Point(96,373));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ROL());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,391));
			points.add(new Point(96,391));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ROLC());
			gui.addLine(line);

			//
			/////////////////////////////////
			
			// 
			// 
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,426));
			points.add(new Point(91,426));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ABBits.getOut(7));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,426+18));
			points.add(new Point(91,426+18));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ABBits.getOut(6));
			gui.addLine(line);
			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,426+18+18));
			points.add(new Point(91,426+18+18));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ABBits.getOut(5));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,426+18+18+17));
			points.add(new Point(91,426+18+18+17));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ABBits.getOut(4));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,426+18+18+18+16));
			points.add(new Point(91,426+18+18+18+16));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ABBits.getOut(3));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,426+18+18+18+18+16));
			points.add(new Point(91,426+18+18+18+18+16));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ABBits.getOut(2));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,426+18+18+18+18+18+16));
			points.add(new Point(91,426+18+18+18+18+18+16));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ABBits.getOut(1));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,426+18+18+18+18+18+18+15));
			points.add(new Point(91,426+18+18+18+18+18+18+15));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ABBits.getOut(0));
			gui.addLine(line);
			
			// 
			// 
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(80,57));
			points.add(new Point(139,57));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ABBits.getOut(7));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(123,241));
			points.add(new Point(130,241));
			points.add(new Point(130,65));
			points.add(new Point(139,65));
			sections.add(points);
			line=new GuiLine(sections,NOR1.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(131,242));
			points.add(new Point(131,479));
			points.add(new Point(139,479));
			sections.add(points);
			line=new GuiLine(sections,NOR1.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(166,61));
			points.add(new Point(174,61));
			sections.add(points);
			line=new GuiLine(sections,NAND1.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(124,488));
			points.add(new Point(139,488));
			sections.add(points);
			line=new GuiLine(sections,ZAND1.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(166,483));
			points.add(new Point(174,483));
			sections.add(points);
			line=new GuiLine(sections,ZAND2.getOut(0));
			gui.addLine(line);

			//
			//
			// 
			// 
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,19));
			points.add(new Point(276,19));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ADD());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(266,32));
			points.add(new Point(277,32));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.INC());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,54));
			points.add(new Point(277,54));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.SUB());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,68));
			points.add(new Point(276,68));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.DEC());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(266,107));
			points.add(new Point(274,107));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ASR());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,125));
			points.add(new Point(276,125));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.LSR());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(266,143));
			points.add(new Point(276,143));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ROR());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,160));
			points.add(new Point(275,160));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.RORC());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,195));
			points.add(new Point(274,195));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ASL());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,213));
			points.add(new Point(276,213));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.LSL());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,230));
			points.add(new Point(276,230));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ROL());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,248));
			points.add(new Point(275,248));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ROLC());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(302,26));
			points.add(new Point(317,26));
			sections.add(points);
			line=new GuiLine(sections,OR_ADD_INC.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(302,61));
			points.add(new Point(317,61));
			sections.add(points);
			line=new GuiLine(sections,OR_SUB_DEC.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(344,32));
			points.add(new Point(360,32));
			points.add(new Point(360,90));
			points.add(new Point(369,90));
			sections.add(points);
			line=new GuiLine(sections,CAND1.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(344,68));
			points.add(new Point(352,68));
			points.add(new Point(352,99));
			points.add(new Point(371,99));
			sections.add(points);
			line=new GuiLine(sections,CAND2.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(344,138));
			points.add(new Point(352,138));
			points.add(new Point(352,107));
			points.add(new Point(371,107));
			sections.add(points);
			line=new GuiLine(sections,CAND2.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(344,226));
			points.add(new Point(360,226));
			points.add(new Point(360,116));
			points.add(new Point(368,116));
			sections.add(points);
			line=new GuiLine(sections,CAND4.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(302,134));
			points.add(new Point(317,134));
			sections.add(points);
			line=new GuiLine(sections,COR1.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(302,222));
			points.add(new Point(317,222));
			sections.add(points);
			line=new GuiLine(sections,COR2.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(395,103));
			points.add(new Point(402,103));
			sections.add(points);
			line=new GuiLine(sections,COR3.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,88));
			points.add(new Point(309,88));
			points.add(new Point(309,39));
			points.add(new Point(317,39));
			sections.add(points);
			line=new GuiLine(sections,Exec1.C8());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(311,74));
			points.add(new Point(313,74));
			sections.add(points);
			line=new GuiLine(sections,Exec1.C8());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,178));
			points.add(new Point(309,178));
			points.add(new Point(309,143));
			points.add(new Point(317,143));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ABBits.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(267,266));
			points.add(new Point(309,266));
			points.add(new Point(309,230));
			points.add(new Point(317,230));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ABBits.getOut(7));
			gui.addLine(line);

			//
			//

			// 
			// 
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(407,301));
			points.add(new Point(415,301));
			points.add(new Point(415,578));
			points.add(new Point(460,578));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ALU7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(416,362));
			points.add(new Point(465,362));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ALU7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(416,398));
			points.add(new Point(461,398));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ALU7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(416,450));
			points.add(new Point(465,450));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ALU7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(416,485));
			points.add(new Point(460,485));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ALU7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(416,530));
			points.add(new Point(465,530));
			sections.add(points);
			line=new GuiLine(sections,Exec1.ALU7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(407,283));
			points.add(new Point(432,283));
			points.add(new Point(432,477));
			points.add(new Point(460,477));
			sections.add(points);
			line=new GuiLine(sections,Exec1.BB7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(433,354));
			points.add(new Point(461,354));
			sections.add(points);
			line=new GuiLine(sections,Exec1.BB7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(433,389));
			points.add(new Point(465,389));
			sections.add(points);
			line=new GuiLine(sections,Exec1.BB7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(433,441));
			points.add(new Point(465,441));
			sections.add(points);
			line=new GuiLine(sections,Exec1.BB7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(407,266));
			points.add(new Point(449,266));
			points.add(new Point(449,569));
			points.add(new Point(465,569));
			sections.add(points);
			line=new GuiLine(sections,Exec1.AB7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(450,521));
			points.add(new Point(460,521));
			sections.add(points);
			line=new GuiLine(sections,Exec1.AB7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(450,468));
			points.add(new Point(465,468));
			sections.add(points);
			line=new GuiLine(sections,Exec1.AB7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(450,433));
			points.add(new Point(460,433));
			sections.add(points);
			line=new GuiLine(sections,Exec1.AB7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(450,380));
			points.add(new Point(465,380));
			sections.add(points);
			line=new GuiLine(sections,Exec1.AB7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(450,345));
			points.add(new Point(460,345));
			sections.add(points);
			line=new GuiLine(sections,Exec1.AB7());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(407,327));
			points.add(new Point(550,327));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.ADD());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(407,415));
			points.add(new Point(550,415));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.SUB());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(407,503));
			points.add(new Point(550,503));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.INC());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(407,551));
			points.add(new Point(550,551));
			sections.add(points);
			line=new GuiLine(sections,Fetch2.DEC());
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(493,354));
			points.add(new Point(500,354));
			points.add(new Point(500,367));
			points.add(new Point(510,367));
			sections.add(points);
			line=new GuiLine(sections,VAND1.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(493,389));
			points.add(new Point(500,389));
			points.add(new Point(500,376));
			points.add(new Point(511,376));
			sections.add(points);
			line=new GuiLine(sections,VAND2.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(493,441));
			points.add(new Point(500,441));
			points.add(new Point(500,455));
			points.add(new Point(510,455));
			sections.add(points);
			line=new GuiLine(sections,VAND4.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(493,477));
			points.add(new Point(500,477));
			points.add(new Point(500,464));
			points.add(new Point(510,464));
			sections.add(points);
			line=new GuiLine(sections,VAND5.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(578,332));
			points.add(new Point(593,332));
			points.add(new Point(593,450));
			points.add(new Point(601,450));
			sections.add(points);
			line=new GuiLine(sections,VAND3.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(578,419));
			points.add(new Point(585,419));
			points.add(new Point(585,459));
			points.add(new Point(604,459));
			sections.add(points);
			line=new GuiLine(sections,VAND6.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(493,525));
			points.add(new Point(543,525));
			points.add(new Point(543,512));
			points.add(new Point(550,512));
			sections.add(points);
			line=new GuiLine(sections,VAND7.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(578,507));
			points.add(new Point(585,507));
			points.add(new Point(585,468));
			points.add(new Point(604,468));
			sections.add(points);
			line=new GuiLine(sections,VAND8.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(493,573));
			points.add(new Point(543,573));
			points.add(new Point(543,560));
			points.add(new Point(550,560));
			sections.add(points);
			line=new GuiLine(sections,VAND9.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(578,556));
			points.add(new Point(593,556));
			points.add(new Point(593,477));
			points.add(new Point(601,477));
			sections.add(points);
			line=new GuiLine(sections,VAND10.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(535,373));
			points.add(new Point(543,373));
			points.add(new Point(543,336));
			points.add(new Point(550,336));
			sections.add(points);
			line=new GuiLine(sections,VOR1.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(535,461));
			points.add(new Point(543,461));
			points.add(new Point(543,424));
			points.add(new Point(550,424));
			sections.add(points);
			line=new GuiLine(sections,VOR2.getOut(0));
			gui.addLine(line);

			//
			//
			sections=new ArrayList<ArrayList<Point>>();
			points=new ArrayList<Point>();
			points.add(new Point(628,463));
			points.add(new Point(636,463));
			sections.add(points);
			line=new GuiLine(sections,VOR3.getOut(0));
			gui.addLine(line);

			//
			//



			
		}
		/////////////
		/////////////
		/////////////
	
	public static void init(){
		
		// Prva slika ( levo )
		//
			NOR1 = new OR(18);
			NAND1 = new AND();
			ZNOT0 = new NOT();
			ZNOT1 = new NOT();
			ZNOT2 = new NOT();
			ZNOT3 = new NOT();
			ZNOT4 = new NOT();
			ZNOT5 = new NOT();
			ZNOT6 = new NOT();
			ZNOT7 = new NOT();
			ZAND1 = new AND(8);
			ZAND2 = new AND();

		// Druga slika ( sredina )
		//
			OR_ADD_INC = new OR();
			OR_SUB_DEC = new OR();
			CAND1 = new AND();
			CNOT1 = new NOT();
			CAND2 = new AND();
			COR1 = new OR(4);
			CAND3 = new AND();
			COR2 = new OR(4);
			CAND4 = new AND();
			COR3 = new OR(4);
		
		// Treca slika ( desno )
		//
			VNOT1 = new NOT();
			VNOT2 = new NOT();
			VAND1 = new AND(3);
			VNOT3 = new NOT();
			VAND2 = new AND(3);
			VOR1 = new OR(2);
			VAND3 = new AND(2);
			//
			VNOT4 = new NOT();
			VAND4 = new AND(3);
			VNOT5 = new NOT();
			VNOT6 = new NOT();
			VAND5 = new AND(3);
			VOR2 = new OR();
			VAND6 = new AND();
			// dodato
			NOT_AB7 = new NOT();
			VAND7 = new AND();
			VAND8 = new AND();
			// dodato:
			NOT_ALU7 = new NOT();
			VAND9 = new AND();
			VAND10 = new AND();
			// izmenjeno
			VOR3 = new OR(4);

	}
	
	public static void connect() {

		// Prva slika ( levo )
		//
			NOR1.setInputPin(0, Fetch2.LDB());
			NOR1.setInputPin(1, Fetch2.POPB());
			NOR1.setInputPin(2, Fetch2.ADD());
			NOR1.setInputPin(3, Fetch2.SUB());
			NOR1.setInputPin(4, Fetch2.INC());
			NOR1.setInputPin(5, Fetch2.DEC());
			NOR1.setInputPin(6, Fetch2.AND());
			NOR1.setInputPin(7, Fetch2.OR());
			NOR1.setInputPin(8, Fetch2.XOR());
			NOR1.setInputPin(9, Fetch2.NOT());
			NOR1.setInputPin(10, Fetch2.ASR());
			NOR1.setInputPin(11, Fetch2.LSR());
			NOR1.setInputPin(12, Fetch2.ROR());
			NOR1.setInputPin(13, Fetch2.RORC());
			NOR1.setInputPin(14, Fetch2.ASL());
			NOR1.setInputPin(15, Fetch2.LSL());
			NOR1.setInputPin(16, Fetch2.ROL());
			NOR1.setInputPin(17, Fetch2.ROLC());
			//
			NAND1.setInputPin(0, Exec1.AB7());
			NAND1.setInputPin(1, NOR1.getOut(0));
			//
			ZNOT0.setInputPin(0, Exec1.AB0());
			ZNOT1.setInputPin(0, Exec1.AB1());
			ZNOT2.setInputPin(0, Exec1.AB2());
			ZNOT3.setInputPin(0, Exec1.AB3());
			ZNOT4.setInputPin(0, Exec1.AB4());
			ZNOT5.setInputPin(0, Exec1.AB5());
			ZNOT6.setInputPin(0, Exec1.AB6());
			ZNOT7.setInputPin(0, Exec1.AB7());
			//
			ZAND1.setInputPin(0, ZNOT0.getOut(0));
			ZAND1.setInputPin(1, ZNOT1.getOut(0));
			ZAND1.setInputPin(2, ZNOT2.getOut(0));
			ZAND1.setInputPin(3, ZNOT3.getOut(0));
			ZAND1.setInputPin(4, ZNOT4.getOut(0));
			ZAND1.setInputPin(5, ZNOT5.getOut(0));
			ZAND1.setInputPin(6, ZNOT6.getOut(0));
			ZAND1.setInputPin(7, ZNOT7.getOut(0));
			//
			ZAND2.setInputPin(0, NOR1.getOut(0));
			ZAND2.setInputPin(1, ZAND1.getOut(0));

		// Druga slika ( sredina )
		//
			OR_ADD_INC.setInputPin(0, Fetch2.ADD());
			OR_ADD_INC.setInputPin(1, Fetch2.INC());
			//
			OR_SUB_DEC.setInputPin(0, Fetch2.SUB());
			OR_SUB_DEC.setInputPin(1, Fetch2.DEC());
			//
			CAND1.setInputPin(0, OR_ADD_INC.getOut(0));
			CAND1.setInputPin(1, Exec1.C8());
			//
			CNOT1.setInputPin(0, Exec1.C8());
			CAND2.setInputPin(0, OR_SUB_DEC.getOut(0));
			CAND2.setInputPin(1, CNOT1.getOut(0));
			//
			COR1.setInputPin(0, Fetch2.ASR());
			COR1.setInputPin(1, Fetch2.LSR());
			COR1.setInputPin(2, Fetch2.ROR());
			COR1.setInputPin(3, Fetch2.RORC());
			//
			CAND3.setInputPin(0, COR1.getOut(0));
			CAND3.setInputPin(1, Exec1.AB0());
			//
			COR2.setInputPin(0, Fetch2.ASL());
			COR2.setInputPin(1, Fetch2.LSL());
			COR2.setInputPin(2, Fetch2.ROL());
			COR2.setInputPin(3, Fetch2.ROLC());
			//
			CAND4.setInputPin(0, COR2.getOut(0));
			CAND4.setInputPin(1, Exec1.AB7());
			//
			COR3.setInputPin(0, CAND1.getOut(0));
			COR3.setInputPin(1, CAND2.getOut(0));
			COR3.setInputPin(2, CAND3.getOut(0));
			COR3.setInputPin(3, CAND4.getOut(0));
			
		// Treca slika ( desno )
		//
			VNOT1.setInputPin(0, Exec1.AB7());
			VNOT2.setInputPin(0, Exec1.BB7());
			VAND1.setInputPin(0, VNOT1.getOut(0));
			VAND1.setInputPin(1, VNOT2.getOut(0));
			VAND1.setInputPin(2, Exec1.ALU7());
			//
			VNOT3.setInputPin(0, Exec1.ALU7());
			VAND2.setInputPin(0, Exec1.AB7());
			VAND2.setInputPin(1, Exec1.BB7());
			VAND2.setInputPin(2, VNOT3.getOut(0));
			//
			VOR1.setInputPin(0, VAND1.getOut(0));
			VOR1.setInputPin(1, VAND2.getOut(0));
			//
			VAND3.setInputPin(0, Fetch2.ADD());
			VAND3.setInputPin(1, VOR1.getOut(0));
			//
			VNOT4.setInputPin(0, Exec1.AB7());
			VAND4.setInputPin(0, VNOT4.getOut(0));
			VAND4.setInputPin(1, Exec1.BB7());
			VAND4.setInputPin(2, Exec1.ALU7());
			//
			VNOT5.setInputPin(0, Exec1.BB7());
			VNOT6.setInputPin(0, Exec1.ALU7());
			VAND5.setInputPin(0, Exec1.AB7());
			VAND5.setInputPin(1, VNOT5.getOut(0));
			VAND5.setInputPin(2, VNOT6.getOut(0));
			//
			VOR2.setInputPin(0, VAND4.getOut(0));
			VOR2.setInputPin(1, VAND5.getOut(0));
			//
			VAND6.setInputPin(0, Fetch2.SUB());
			VAND6.setInputPin(1, VOR2.getOut(0));
			// dodato
			NOT_AB7.setInputPin(0, Exec1.AB7());
			VAND7.setInputPin(0, NOT_AB7.getOut(0));
			VAND7.setInputPin(1, Exec1.ALU7());
			VAND8.setInputPin(0, Fetch2.INC());
			VAND8.setInputPin(1, VAND7.getOut(0));
			// dodato
			NOT_ALU7.setInputPin(0, Exec1.ALU7());
			VAND9.setInputPin(0, NOT_ALU7.getOut(0));
			VAND9.setInputPin(1, Exec1.AB7());
			VAND10.setInputPin(0, Fetch2.DEC());
			VAND10.setInputPin(1, VAND9.getOut(0));
			// izmenjeno
			VOR3.setInputPin(0, VAND3.getOut(0));
			VOR3.setInputPin(1, VAND6.getOut(0));
			VOR3.setInputPin(2, VAND8.getOut(0));
			VOR3.setInputPin(3, VAND10.getOut(0));

	}

	public static Pin N() {
		return NAND1.getOut(0);
	}

	public static Pin Z() {
		return ZAND2.getOut(0);
	}

	public static Pin C() {
		return COR3.getOut(0);
	}

	public static Pin V() {
		return VOR3.getOut(0);
	}


}
